﻿using PLCS.Application.Contracts.TaskApp.Dtos;

namespace PLCS.Application.Contracts.TaskApp;

public interface ITaskAppService : ICrudAppService<TaskDto, Guid, PagedResultRequestDto, TaskEditDto>
{
    /// <summary>
    /// 通过任务ID获取任务
    /// </summary>
    /// <param name="taskId"></param>
    /// <returns></returns>
    Task<TaskDto> GetByTaskIdAsync(int taskId);

    /// <summary>
    /// 发送任务
    /// </summary>
    /// <param name="taskInputDto"></param>
    /// <returns></returns>
    Task SendTaskAsync(TaskEditDto taskInputDto);

    /// <summary>
    /// 修改任务
    /// </summary>
    /// <param name="taskInputDto"></param>
    /// <returns></returns>
    Task UpdateAsync(TaskEditDto taskInputDto);

    /// <summary>
    /// 重新下发
    /// </summary>
    /// <param name="Id"></param>
    /// <param name="taskStatus"></param>
    /// <returns></returns>
    Task AgainIssuedAsync(Guid Id);

    /// <summary>
    /// 手动完工
    /// </summary>
    /// <param name="Id"></param>
    /// <returns></returns>
    Task FinshTaskAsync(Guid Id);

    /// <summary>
    /// 根据条件查询
    /// </summary>
    /// <param name="input"></param>
    /// <param name="taskNo"></param>
    /// <param name="taskType"></param>
    /// <param name="status"></param>
    /// <param name="trayNo"></param>
    /// <returns></returns>
    Task<PagedResultDto<TaskDto>> GetListBySearchAsync(PagedResultRequestDto input, string? taskNo, string? taskType, string? status, string? trayNo);
}